<?php
/**
 *
 * @license   https://www.rongyun.cc
 * @link      https://www.rongyun.cc
 * @author    wangyadong<wangyadong280@gmail.com>
 * @date      2017-04-13 14:52
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Category extends Model
{
    protected $table = 'categories';

    protected $fillable = [
        'user_id', 'category_name', 'created_at', 'updated_at',
    ];

    public function user()
    {
        return $this->belongsTo('App\Models\Users');
    }

    public function bookmarks()
    {
        return $this->hasMany('App\Models\Bookmark', 'category_id');
    }
}